import request from '@/utils/request'
function getUrl(url) { return '/api/' + url }


//添加管理员信息
export function addInRole(data) {
    return request({
        url: getUrl("admin/role/addInRole"),
        method: 'post',
        data
    })
}

//更新管理员信息
export function updateInRole(data) {
    return request({
        url: getUrl("admin/role/updateInRole"),
        method: 'post',
        data
    })
}

//更新角色状态信息
export function updateInRoleStatus(data) {
    return request({
        url: getUrl("admin/role/updateInRoleStatus"),
        method: 'post',
        data
    })
}

//删除角色
export function deleteInRole(data) {
    return request({
        url: getUrl("admin/role/deleteInRole"),
        method: 'post',
        data
    })
}
//获取角色信息数据 getInRoleVo
export function getInRoleVo(data) {
    return request({
        url: getUrl("admin/role/getInRoleVo"),
        method: 'post',
        data
    })
}

export function getInRoleList(data) {
    return request({
        url: getUrl("admin/role/getInRoleList"),
        method: 'post',
        data
    })
}

//初始化菜单资源信息数据
export function initPermission(data) {
    return request({
        url: getUrl("admin/role/initPermission"),
        method: 'post',
        data
    })
}

export function getInPermissionList(data) {
    return request({
        url: getUrl("admin/role/getInPermissionList"),
        method: 'post',
        data
    })
}

//获取所有父级资源列表数据
export function getParentPermissionsByType(data) {
    return request({
        url: getUrl('admin/role/getParentPermissionsByType'),
        method: 'post',
        data
    })
}

//新增菜单
export function addInPermission(data) {
    return request({
        url: getUrl('admin/role/addInPermission'),
        method: 'post',
        data
    })
}

//编辑菜单
export function updateInPermission(data) {
    return request({
        url: getUrl('admin/role/updateInPermission'),
        method: 'post',
        data
    })
}

//删除菜单
export function deleteInPermission(data) {
    return request({
        url: getUrl('admin/role/deleteInPermission'),
        method: 'post',
        data
    })
}

//修改菜单
export function getInPermissionVo(data) {
    return request({
        url: getUrl('admin/role/getInPermissionVo'),
        method: 'post',
        data
    })
}
